<template>
  <el-form ref="form" :model="form" label-width="80px">
    <el-form-item label="用户名">
      <el-input v-model="form.username" placeholder="请输入用户名"></el-input>
    </el-form-item>
    <el-form-item label="密码">
      <el-input
        placeholder="请输入密码"
        v-model="form.password"
        show-password
      ></el-input>
    </el-form-item>
    <!-- <el-form-item label="确认密码">
      <el-input
        placeholder="请再次输入密码"
        v-model="form.password"
        show-password
      ></el-input>
    </el-form-item> -->
    <el-form-item label="生成密钥">
      <el-input

        v-model="form.private_key"
        readonly="readonly"
        type="textarea"
        :rows="4"
        resize="none"
      ></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">注册</el-button>
      <el-button @click="toLogin">登录</el-button>
    </el-form-item>
  </el-form>
</template>
<script>
export default {
  data() {
    return {
      form: {
        username: "",
        password: "",
        private_key: "",
      },
    };
  },
  methods: {
    onSubmit() {
      this.$router.push({ path: "/home" });
      console.log("submit!");
    },
    toLogin(){
        this.$router.push({path:"/preHome"})
    }
  },
};
</script>